﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Knihotoc_WP8.Localization;
using Knihotoc_WP8.Settings;

namespace Knihotoc_WP8.Pages
{
    public partial class BookReturnPage : PhoneApplicationPage
    {
        private int bookID;


        public BookReturnPage()
        {
            this.InitializeComponent();
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (NavigationContext.QueryString.ContainsKey("BookID"))
            {

                bookID = Convert.ToInt32(NavigationContext.QueryString["BookID"]);

            }
        }

        private void ReturnToCurrentPositionButton_Click(object sender, RoutedEventArgs e)
        {
            float lat = (float)CurrentSettings.Instance.CurrentPosition.Latitude;
            float lon = (float)CurrentSettings.Instance.CurrentPosition.Longitude;
            string description = "";
            int? place = null;
        }

        private void ReturnToCommonPlaceButton_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Pages/CommonPlaceListPage.xaml?BookID=" + bookID, UriKind.Relative));
        }

        private void ChoosePositionFromMapButton_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Pages/ChoosePositionFromMapPage.xaml?BookID=" + bookID, UriKind.Relative));
        }
    }
}